#ifndef SERVER_LISTENER_H
#define SERVER_LISTENER_H



#include <QTcpServer>
#include <QTcpSocket>



enum PlayerType { local, ai, network };



const int PL=2;



class Server:public QTcpServer
{

	Q_OBJECT

public:

	Server(QObject* parent=0);
	~Server();

	void send_string(QString s,QTcpSocket* r);

	QTcpSocket* clients[PL];
	int clients_num;


private slots:

	void add_client();

};



class sl
{

public:
	
	static sl* get_instance();

	Server* server;

	int x;


private:

	sl(int _x):x(_x){};
	sl(const sl&);
	sl& operator=(const sl& x);

};



static sl* server_listener=sl::get_instance();



#endif